<?php
/**
 * Service
 * 
 * 作者:  姚刚 (yaogang@the9sense.com)
 * 创建时间: 2011-02-24 00:17:39
 * 修改记录: 
 * 
 * $Id: Service.php 4 2011-03-10 16:39:54Z coosuu@gmail.com $
 */

class Service {

    private static $_instances = array();

    public static function &factory($name) {

        $className = APP_NAME . '_Service_' . ucwords(strtolower($name));
        if (!array_key_exists($className, self::$_instances)) {
            self::$_instances[$className] = new $className;
        }
        return self::$_instances[$className];
    }
}
